#include "metafield.h"

MetaField::MetaField()
{
}

QString const & MetaField::getFieldName() const
{
    return this->m_fieldName;
}
void MetaField::setFieldName(QString& name)
{
    this->m_fieldName = name;
}

QVariant MetaField::get(QObject* instance)
{
    return instance->property(m_fieldName.toAscii());
}

void MetaField::set(QObject* instance, QVariant val)
{
    if (instance) {
        cout << "class loaded\n";
        instance->setProperty(m_fieldName.toAscii(), val);
    } else {
        cout << "null instance";
    }
}
